
<!DOCTYPE html>
<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:utils="http://java.sun.com/jsf/composite/utils"
	xmlns:sec="http://www.springframework.org/security/tags"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link href="resources/styles/main.css" rel="stylesheet" type="text/css" />
</h:head>

<h:body>
	<div id="header">
		<ui:insert name="header">
			<ui:include src="/header.xhtml">
			    <ui:param name="title" value="Employee"/>
			</ui:include>
		</ui:insert>
	</div>

	<h:form id="employeeform">
		<p:dataTable var="rec"
			rowKey="#{rec.usrname}" paginator="true" rows="5" value="#{employeeViewBean.employees}"
			selection="#{employeeViewBean.selectedEmployee}" selectionMode="single"
			id="employeeTable" rowsPerPageTemplate="5,10,15,25,50,100">

			<f:facet name="header">  
            List of Employees (#{employeeViewBean.length}) 
        </f:facet>
        <p:column headerText="ID" sortBy="#{rec.id}"
				filterBy="#{rec.id}" id="id">  
            #{rec.id}  
        </p:column>
			<p:column headerText="Usrname" sortBy="#{rec.Usrname}"
				filterBy="#{rec.Usrname}" id="Usrname">  
            #{rec.Usrname}  
        </p:column>
        
        <p:column headerText="Stateid" sortBy="#{rec.Stateid}"
				filterBy="#{rec.Stateid}" id="Stateid">  
            #{rec.Stateid}  
        </p:column>
	        
			<f:facet name="footer">
				<p:commandButton id="viewButton" value="View" icon="ui-icon-search"
					oncomplete="employeeDialog.show()" />
				<p:commandButton id="createButton" value="Create"
					icon="ui-icon-search" oncomplete="employeeDialog.show()" />
			</f:facet>
		</p:dataTable>

		<p:dialog header="Employee Detail" widgetVar="employeeDialog"
			resizable="false" showEffect="explode"
			hideEffect="explode" modal="true">
			<h:panelGrid columns="1" cellspacing="20">
				<ui:include src="/employeeDetail.xhtml" />
			</h:panelGrid>
		</p:dialog>
	</h:form>
	<div id="footer">
		<ui:insert name="footer">
			<ui:include src="/footer.xhtml" />
		</ui:insert>
	</div>
</h:body>
</html>
